<%@ page contentType="text/html; charset=UTF-8" language="java" import="com.config.SystemGlobals,com.util.*,java.util.*" errorPage="/error.jsp" %>
<%@ page import="com.beans.log.*" %>
<%@ page import="com.business.log.*" %>
<%@ page import="com.beans.link.*" %>
<%@ page import="com.business.link.*" %>
<%@ page import="com.beans.user.*" %>
<%@ page import="com.business.user.*" %>
<%@ page import="com.beans.photo.*" %>
<%@ page import="com.business.photo.*" %>
<%  
	LogListBus llb=new LogListBus();
	UserListBus uis=new UserListBus();
	LogReplyBus lrb=new LogReplyBus();
	LogTypeBus ltb=new LogTypeBus();
	PhotoTypeBus ptb=new PhotoTypeBus();
	String photoNo=request.getPathInfo();
    photoNo=photoNo.replace(".html","");
    photoNo=photoNo.replace("/","");
   if(photoNo==null) {
		response.sendRedirect("/error.jsp");
	}
	PhotoListBus plb=new PhotoListBus();
	
	PhotoReplyBus prb=new PhotoReplyBus();
	
List replyList=prb.getReplyByPhotoNo(photoNo);
	
	if(session.getAttribute("photoNos")==null){
			session.setAttribute("photoNos",photoNo);
			plb.addViewCount(photoNo);
		}else{
		String photoNos=(String)session.getAttribute("photoNos");
		if(photoNos.indexOf(photoNo)==-1){
		photoNos+=photoNo;
		session.setAttribute("photoNos",photoNos);
		plb.addViewCount(photoNo);}
		}
		PhotoDetail pd=plb.getPhotoByNo(photoNo);
		String username=pd.getUsername();
	UserInfo ui=uis.getUserInfo(username);
	String title=pd.getPhotoName();
	String phototypeId=pd.getPhototypeId();
		int id=Integer.parseInt(phototypeId);
     	PhotoType pt=ptb.getPhotoTypeById(id);	
%>
<%@ include file="/header.jsp"%>
<body>
<a name="top"></a>
<div id=container>
<%@ include file="/top.jsp"%>
<div id=Tbody>
<div id=mainContent>
<div id=innermainContent>
<div id=mainContent-topimg></div>
<div class=content-width id=Content_ContentList>
<div class=pageContent>

<div style="FLOAT: right; WIDTH: auto">
<%if(!((PhotoDetail)plb.getFrontPhoto(username,photoNo)).getPhotoName().equals("")){%><A 
title="上一幅图片: <%=((PhotoDetail)plb.getFrontPhoto(username,photoNo)).getPhotoName()%>" 
href="photo/temp/<%=((PhotoDetail)plb.getFrontPhoto(username,photoNo)).getPhotoNo()%>.html"><IMG alt="" 
src="images/Cprevious.gif" border=0>上一幅</A><%} else{%><IMG alt="" 
src="images/Cprevious.gif" border=0>上一幅<%}%> | <%if(!((PhotoDetail)plb.getNextPhoto(username,photoNo)).getPhotoName().equals("")){%><A 
title="下一幅图片: <%=((PhotoDetail)plb.getNextPhoto(username,photoNo)).getPhotoName()%>"  href="photo/temp/<%=((PhotoDetail)plb.getNextPhoto(username,photoNo)).getPhotoNo()%>.html"><IMG alt="" 
src="images/Cnext.gif" border=0>下一幅</A> <%}else{%><IMG alt="" 
src="images/Cnext.gif" border=0>下一幅<%}%></div><%if(!pt.getPhototypeName().equals("")){%><IMG style="MARGIN: 0px 2px -4px 0px" alt="" src="images/6.gif"> <strong><A title="<%=pt.getPhototypeMemo()%>" href="photolist/<%=username%>/<%=pt.getPhototypeId()%>.html"><%=pt.getPhototypeName()%> </A></strong><%}%></div>
<div class=Content>
<div class=Content-top>
<div class=ContentLeft></div>
<div class=ContentRight></div>
<h1 class=ContentTitle><strong><%=pd.getPhotoName()%>  </strong></h1>
<h2 class=ContentAuthor>描述：<%=pd.getPhotoMemo()%> 日期:<%=pd.getAddTime()%></h2></div>
<div class=Content-Info>
</div>
<div class=Content-body 
id=logPanel>
<a href="<%=basePath+pd.getPhotoUrl()%>"><img alt="点击看原图"src="<%=basePath+pd.getPhotoUrl()%>"   width="100%" height="400" border="0" /></a>
</div>

</div></div>
<DIV class=Content-bottom>
<DIV class=ContentBLeft></DIV>
<DIV class=ContentBRight></DIV>回复: <%=replyList.size()%></A> |  
查看次数:<%=pd.getViewCount()%></DIV>
<div class=comment>
<% 
if(replyList==null||replyList.size()==0) {
%>
<br/>
<b>
还没有回复此日志
</b>
<% } else {
 for(int i=0;i<replyList.size();i++) {
 PhotoReply lr=(PhotoReply)replyList.get(i); 
 %>
<div class=commenttop><IMG style="MARGIN: 0px 4px -3px 0px" alt="" 
src="images/icon_quote.gif" border=0></a><A 
href="about/<%=lr.getNickname()%>/"><strong><%=lr.getNickname()%></strong></A> 
<SPAN class=commentinfo>[<%=lr.getReplyTime().replace("-","/")%>]</SPAN></div>
<div class=commentcontent 
id=commcontent_1674><%=lr.getReplyContent()%></div>
<%
	}
}
%></div>

<div style="FLOAT: right;margin-right:50px"><A title="返回顶部"
href="#top"><IMG 
style="MARGIN-BOTTOM: -1px" alt="返回顶部"
src="images/top.gif" border=0> </A></div>
<div id=MsgContent style="WIDTH: 94%">
<div id=MsgHead>发表评论</div>
<div id=MsgBody>
<form id="replyform" name="replyform" method="post" action="replyphoto?id=<%=photoNo%>" style="MARGIN: 0px">
  <p  style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px" 
    align=left>回复名：
    <label>
    <input name="nickname" type="text" class=userpass value="<%=session.getAttribute("login_user")==null?"":(String)session.getAttribute("login_user")%>"/>  
	 <%if(session.getAttribute("password")==null){%><a href="user/login.jsp">登录</a>
    </label>
  </p>

  <p  style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px" 
    align=left>
  密码：
    <label>
    <input name="password" class=userpass type="password" id="password"  />
    </label>
</p><%} else{%> </label>
  </p>
	<input name="password" class=userpass type="hidden" value="<%=(String)session.getAttribute("password")%>"/>

<% }%>
  <p  style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px" 
    align=left>验证码：
    <label>
    <input type="text" name="authencode" class="userpass" /><img src="AuthenCode?authenName=AuthenCode&heigth=20" align="absmiddle">
    </label>
  </p>
  <p  style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px" 
    align=left>回复内容：</p>
  <p>
    <label>
    <textarea name="replycontent" cols="60" rows="10" class=editTextarea></textarea>
    </label>
  </p>
  <p>
    <label>
    <input name="Submit" type="submit" class="userpass" value="提交" />
    </label>
  	</form>
</div></div>
<div id=mainContent-bottomimg></div></div></div>
<%@ include file="/sidebar.jsp"%>
<%@ include file="/footer.jsp" %>
</body>
</html>